﻿package mortal.game.view.guild.tabpanel
{
    import com.gengine.core.*;
    import com.gengine.resource.*;
    import com.mui.controls.*;
    import flash.display.*;
    import flash.events.*;
    import mortal.common.*;

    public class GuildBasePanel extends GSprite implements IGuildPanel
    {
        protected var _isLoadComplete:Boolean = false;
        protected var _uiRes:String;

        public function GuildBasePanel(param1:String)
        {
            this._uiRes = param1;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            configEventListener(MouseEvent.CLICK, this.onMouseClick);
            LoaderHelp.addResCallBack(this._uiRes, this.onResLoadComplete);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            LoaderHelp.removeResEvent(this._uiRes, this.onResLoadComplete);
            this.quickDispose();
            this._isLoadComplete = false;
            return;
        }// end function

        protected function onResLoadComplete() : void
        {
            this._isLoadComplete = true;
            this.layoutUI();
            this.update();
            return;
        }// end function

        public function get isLoadComplete() : Boolean
        {
            return this._isLoadComplete;
        }// end function

        public function layoutUI() : void
        {
            return;
        }// end function

        public function update() : void
        {
            return;
        }// end function

        public function onMouseClick(event:MouseEvent) : void
        {
            return;
        }// end function

        public function quickDispose() : void
        {
            var _loc_2:DisplayObject = null;
            var _loc_1:* = this.numChildren;
            while (_loc_1 > 0)
            {
                
                _loc_2 = this.getChildAt(0);
                if (_loc_2 is IDispose)
                {
                    (_loc_2 as IDispose).dispose(true);
                }
                else
                {
                    DisplayUtil.removeMe(_loc_2);
                }
                _loc_1 = _loc_1 - 1;
            }
            removeEventListener(MouseEvent.CLICK, this.onMouseClick);
            return;
        }// end function

    }
}
